﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MethodWorx.Core.DomainModel
{
    public interface IUnitOfWork : IDisposable
    {
        /// <summary>
        /// Commit the unit of work
        /// </summary>
        void Commit();
        /// <summary>
        /// Cancel the unit of work
        /// </summary>
        void Cancel();

        bool IsOpen { get; }

        void RegisterChanged<T>(T entity) where T : AggregateRoot;
        void RegisterDeleted<T>(T entity) where T : AggregateRoot;
        void RegisterAdded<T>(T entity) where T : AggregateRoot;
    }

}
